/**
    商品配置 组件
**/
(function (vc) {

    vc.extends({
        data: {
            shopConfigInfo: {
                shopId: '',
                ostartTime: '',
                oendTime: '',
                sendWay:'',
                sendFee:'',
            }
        },
        _initMethod: function () {
            //根据请求参数查询 查询 业主信息
            $that._loadShopConfigInfoData();
        },
        _initEvent: function () {
            vc.on('shopConfig', 'listShopConfig', function (_params) {
                $that._loadShopConfigInfoData();
            });
        },
        methods: {

            _openEditShopConfigInfoModel() {
                vc.emit('editShopConfig', 'openEditShopConfigModal', $that.shopConfigInfo);
            },
            _loadShopConfigInfoData: function () {
                let param = {
                    params: {
                        page:1,
                        row:1,
                        shopId:vc.getCurrentCommunity().shopId
                    }
                };

                //发送get请求
                vc.http.apiGet('/shopConfig.listShopConfig',
                    param,
                    function (json, res) {
                        let _json = JSON.parse(json);
                        if(_json.data.length<1){
                            return;
                        }
                        vc.copyObject(_json.data[0],$that.shopConfigInfo);
                    }, function (errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            }
        }
    });

})(window.vc);
